package com.li.server;

import java.util.List;

import com.li.client.entities.BookInfo;
import com.li.server.dao.BookInfoDao;
import com.li.server.dao.BookInfoDaoImpl;

public class BookServiceImpl implements BookService {
	private BookInfoDao bookInfoDao = new BookInfoDaoImpl();

	@Override
	public Boolean borrowBook(String userId, String isbnCode) {
		return bookInfoDao.borrowBook(userId, isbnCode);
	}

	@Override
	public List<BookInfo> getAllBookInfo() {
		return bookInfoDao.getAllBookInfo();
	}

	@Override
	public BookInfo getBookByISBN(String isbnCode) {
		return bookInfoDao.getBookByISBN(isbnCode);
	}

	@Override
	public Boolean returnBook(Integer pkUserId, Integer pkBookId) {
		return bookInfoDao.returnBook(pkUserId, pkBookId);
	}

	@Override
	public Integer getBookInStock(String isbnCode) {
		return bookInfoDao.getBookInStock(isbnCode);
	}

	@Override
	public Boolean batchInsert(List<BookInfo> bookInfoList) {
		return bookInfoDao.batchInsert(bookInfoList);
	}

}
